package com.cskaoyan.app.wxcontroller;

import com.cskaoyan.app.bean.common.BaseRespVo;
import com.cskaoyan.app.wxservice.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    private WxCatalogService wxCatalogService;

    @GetMapping("index")
    public Object index() {
        Map<String, Object> data = wxCatalogService.index();
        return BaseRespVo.ok(data);
    }

    @GetMapping("current")
    public Object current(Integer id) {
        Map<String, Object> data = wxCatalogService.current(id);
        return BaseRespVo.ok(data);
    }
}
